#pragma once

#include "CTableBase.h"
#include <vector>
#include <map>
#include <string>

class CLogField;
typedef std::shared_ptr<CLogField> CLogFieldPtr;

class CUKeyUValueCalc
{
public:
	CUKeyUValueCalc(CTableBase* tablePtr);

	void CalculateUKeyUValue(const CLogRecordPtr& logRecord);

	uint64_t getUKey() const;
	uint64_t getUValue() const;

private:
	uint64_t CalculateCRC32FromFields(const std::vector<std::string>& fieldNames, 
	                                 const std::map<std::string, CLogFieldPtr>& recordFields,
	                                 const std::string& fieldType);

public:
	CTableBase* m_tablePtr;
	uint64_t m_uKey = 0;
	uint64_t m_uValue = 0;
};

